package com.example.demo.model.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Api(tags = "ModelController测试类")
public class ModelController {

    private Logger log = LoggerFactory.getLogger(this.getClass());

    @GetMapping("test")
    @ApiOperation(value = "测试类")
    @ApiImplicitParam(name = "测试", value = "获取执行时间", required = true, paramType = "query", dataType = "java.lang.String")
    public String getTest() throws InterruptedException {
        long startTime = System.currentTimeMillis();

        Thread.sleep(10);

        long endTime = System.currentTimeMillis();

        log.info("方法执行时间（ms）：" + (endTime - startTime));
        return "test";
    }
}
